package com.lds.config.center.server.business.itemchange.converter;

import com.lds.config.center.common.model.itemchange.request.ItemChangeBaseGetByKeyRequest;
import com.lds.config.center.server.business.itemchange.entity.ItemChange;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class ItemChangeBaseGetByKeyRequestToEntityConverter implements Converter<ItemChangeBaseGetByKeyRequest, ItemChange> {

    @Override
    public ItemChange convert(ItemChangeBaseGetByKeyRequest source) {
        return ItemChange.builder()
                .name(source.getName())
                .namespaceId(source.getNamespaceId())
                .build();
    }

}